# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=libqtdbusmock
pkgver=0.9.0
pkgrel=0
pkgdesc="Library for mocking DBus interactions using Qt"
url='https://gitlab.com/ubports/development/core/libqtdbusmock'
arch="all"
license="LGPL-3.0-only"
makedepends="
	cmake
	cmake-extras
	gmock
	gtest-dev
	libqtdbustest
	networkmanager-dev
	qt5-qtbase-dev
	samurai
	"
checkdepends="
	py3-dbusmock
	procps
	"
source="https://gitlab.com/ubports/development/core/libqtdbusmock/-/archive/$pkgver/libqtdbusmock-$pkgver.tar.gz
	0001-Set-default-C-version-to-C-17.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
8a252cc070e42ba0dd3733ad1fd61a470f25ad76d3f17840113779d2ed212f5fead82e5e26b2368d61ca08cf49f4ef6ab16e15b0374727ce8fb78e964ccb7926  libqtdbusmock-0.9.0.tar.gz
d94e1faee1d2eb37515e8d92983acfaf561ea8f7b3bcc11d78ee8dcf269eeea518820fff2b910b756a9f9b409a39361b4c548f83695484432e40bee9238a7fff  0001-Set-default-C-version-to-C-17.patch
"
